package com.sxt.domain;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * 客户实体类
 * bus_customer
 * @author 
 */
@Data
public class BusCustomer implements Serializable {
    /**
     * 客户ID
     */
    private Integer id;

    /**
     * 客户名称
     */
    @NotEmpty(message = "name:姓名不能为空")
    @Length(max = 20, message = "name:姓名最多20位字符")
    private String name;

    /**
     * 客户电话
     */
    @NotEmpty(message = "phone:手机号不能为空")
    @Length(min = 11, max = 11, message = "phone:手机号11位字符")
    private String phone;

    /**
     * 客户地址
     */
    @NotEmpty(message = "address:地址不能为空")
    @Length(max = 100, message = "address:地址最多100个字符")
    private String address;

    /**
     * 身份证号
     */
    @NotEmpty(message = "idCard:身份证号不能为空")
    @Length(min = 18, max = 18, message = "idCard:身份证号18位字符")
    private String idCard;

    /**
     * 性别 1 男 2女
     */
    @NotNull(message = "sex:性别不能为空")
    @Range(min = 1, max = 2, message = "sex:性别只能是男(1)或者女(2)")
    private Integer sex;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date createTime;

    /**
     * 修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date updateTime;

    private static final long serialVersionUID = 1L;
}